Skip to content

Conversation

@bukka
Copy link
Member

@bukka bukka commented Sep 27, 2025

Currently filter seeking does not work correctly for most streams. The idea is to extend API to allow seeking for some streams. There are couple of cases:

  • filter is always seekable - e.g. string.rot13, string.toupper, string.tolower
  • filter is seekable only when sought to start or when it re-run the data from the start (it means when there is some data buffered) - this is for pretty much all other filters that keep some state.
  • user filters are seekable by default for BC reason but if new seek method is implemented, then it is called and based on the bool result the seeking either fails or succeed.

The seeking to zero is implemented by resetting the internal state.

Fixes https://bugs.php.net/bug.php?id=49874

@bukka
Copy link
Member Author

bukka commented Sep 27, 2025

Just to note that the current implementation is just an API draft that is not really tested. It's also does not handle the buffered procession and no current filter implements it. Also it will need proper tests.

@bukka bukka force-pushed the stream_filter_seeking branch from e78adee to 41aee5a Compare November 21, 2025 11:51
@bukka bukka marked this pull request as ready for review November 24, 2025 22:01
@bukka
Copy link
Member Author

bukka commented Nov 24, 2025

This is now ready for review.

@bukka bukka requested a review from ndossche November 24, 2025 22:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant